<!DOCTYPE html>
<html lang = "en">
<head>
    <meta charset = "UTF-8">
    <title>趋数-智能人岗匹配系统</title>
    <link rel = "stylesheet" href = "../static/common.css">
    <link rel = "stylesheet" href = "../static/admin.css">
    <link rel = "stylesheet" href = "../static/bootstrap-4.0.0/dist/css/bootstrap.min.css">
    <link rel = "stylesheet" href = "https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel = "icon" type = "image/x-icon" href = "../static/images/bitbug_favicon.ico"/>
</head>
<body>
<div class = "app-container">
    <div class = "menu-container">
        <div class = "user-profile">
            <span>
                {% if user %}
                {{user.username}} <a href = "/login.html" style = "font-size:13px;">退出</a>
                {% else %}
                游客模式
                {% endif %}
            </span>
        </div>
        <div>
            <ul class = "menu-list">
                <li class = ""><a href = "main.html">简历搜索</a></li>
                <li class = ""><a href = "contact.html">联系方式</a></li>
                <li class = ""><a href = "sysconfig.html">系统设置</a></li>
                {% if user['role'] == 'admin' %}
                <li class = "active"><a href = "admin.html">管理员</a></li>
                {% endif %}
            </ul>
        </div>
    </div>
    <div class = "pane-container">
        <div class = "pane-container-inner">
            <ul class = "nav nav-tabs">
                <li class = "nav-item">
                    <a class = "nav-link active" href = "#" tar = 'contact-manager'>联系方式</a>
                </li>
                <li class = "nav-item">
                    <a class = "nav-link" href = "#" tar = 'account-manager'>开设账户</a>
                </li>
            </ul>
            <div class = "account-manager hidden mt20">
                <div class = "tr mt10">
                    <button type = "button" class = "btn btn-danger na-btn">新增账户</button>
                </div>
                <div style = "margin-top:10px;" class = "na-container hidden">
                    <form class = "form-inline">
                        <div class = "form-group mx-sm-3">
                            <input type = "text" class = "form-control" id = "na-name" placeholder = "新账户名">
                            <input type = "text" class = "form-control ml-2" id = "na-pwd" placeholder = "初始密码">
                        </div>
                        <button type = "button" class = "btn btn-danger na-sure">确定</button>
                        <button type = "button" class = "btn btn-light ml-2 na-cancel">取消</button>
                    </form>
                </div>
                <div class = "mt20">
                    <table class = "table table-striped">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>用户名</th>
                            <th>用户ID</th>
                            <th>用户权限</th>
                            <th>创建时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for item in user_list %}
                        <tr>
                            <th scope = "row">{{loop.index}}</th>
                            <td>{{item['username']}}</td>
                            <td>{{item['uid']}}</td>
                            <td>{{item['role']}}</td>
                            <td>{{item['ctime']}}</td>
                        </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
            <div class = "contact-manager mt20">
                <table class = "table table-striped resume_list">
                    <thead>
                    <tr>
                        <th scope = "col">#</th>
                        <th scope = "col">性别</th>
                        <th scope = "col">期望从事职业</th>
                        <th scope = "col">期望工作地点</th>
                        <th scope = "col">平台</th>
                        <th scope = "col" style = "width:170px;">联系方式</th>
                        <th scope = "col" style = "text-align:center;">编辑</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for item in contact_list %}
                    <tr id = '{{item["id"]}}'>
                        <th scope = "row">{{loop.index}}</th>
                        <td>{{item['personal_info']['sex']}}</td>
                        <td>
                            <a href = "/detail.html?id={{item['id']}}" target = "_blank">{{item['wanted_job']['title']}}</a>
                        </td>
                        <td>{{item['wanted_job']['location']}}</td>
                        <td>{{item['platform']}}</td>
                        <td class = "contact_information" style = "">{{item['contact_information']}}</td>
                        <td style = "text-align:center;"><i class = "fa fa-edit pt" title = "点我编辑"></i></td>
                    </tr>
                    {% endfor %}
                    <tr class = "input-contact-info hidden">
                        <td colspan = "7">
                            <form class = "form-inline">
                                <div class = "form-group mx-sm-3">
                                    <input type = "text" class = "form-control" id = "contact-info" placeholder = "联系方式">
                                </div>
                                <button type = "button" class = "btn btn-danger sure">确定</button>
                                <button type = "button" class = "btn btn-light ml-2 cancel">取消</button>
                            </form>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<script src = "../static/js/jquery.min.js"></script>
<script src = "../static/admin.js"></script>
</body>
</html>